import React from 'react';
import Mvchlid from './mvchild'
import Axios from 'axios';

class Mv extends React.Component{
    constructor(props) {
        super(props);
        this.state={
			res:'',
		}
    }
    componentWillMount(){
		var that =this;
		Axios({
			method:'post',
			url:'http://10.31.160.62:3000/getmv',
			dataType:'json'
		}).then(function(res){
			that.setState({
				res:res.data,
			})
		})	
	}
    render(){
        var _res = this.state.res.msg;
        var html=[];
        if(_res){
            for(var i=0;i<_res.length;i++){
                html.push(
                    <Mvchlid key={i} {..._res[i]}/>
                )
            }
        }
        return(
            <div>
                <div className="mod_index mod_index--mv mod_slide_box">
                    <div className="section_inner goo">
                        <div className="index__hd">
                            <h2 className="index__tit">
                                <i className="index__tit_sprite"></i>
                                <i className="icon_txt">MV首播</i>
                            </h2>
                            <i className="index__line index__line--left"></i>		
                            <i className="index__line index__line--right"></i>
                        </div>
                        <a href="##" className="index__more js_mvlist_more">
                            全部
                            <i className="icon_index_arrow"></i>
                        </a>
                        <div className="mod_index_tab">
                            <a href="javascript:;" className="js_tab index_tab__item index_tab__item--current">全部</a>
                            <a href="javascript:;" className="js_tab index_tab__item">内地</a>
                            <a href="javascript:;" className="js_tab index_tab__item">港台</a>
                            <a href="javascript:;" className="js_tab index_tab__item">欧美</a>
                            <a href="javascript:;" className="js_tab index_tab__item">韩国</a>
                            <a href="javascript:;" className="js_tab index_tab__item">日本</a>
                        </div>
                        <div className="mod_mv">
                            <ul className="mv_list__list">
                                {html}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        )
    }
}

export default Mv;